package jia.core.calculations;

/**
 * Class for calculating the modifier value of a given attribute score
 *
 * @author Erik Stell
 * @version 1.0
 * @since 01/19/2006
 */
public class AttributeModifier {

	public static int calculateMod(int score) {
		int retVal;
		if (score > 0 && score <= 1) {
			retVal = -5;

		} else if (score >= 2 && score <= 3) {
			retVal = -4;

		} else if (score >= 4 && score <= 5) {
			retVal = -3;

		} else if (score >= 6 && score <= 7) {
			retVal = -2;

		} else if (score >= 8 && score <= 9) {
			retVal = -1;

		} else if (score >= 10 && score <= 11) {
			retVal = 0;

		} else if (score >= 12 && score <= 13) {
			retVal = 1;

		} else if (score >= 14 && score <= 15) {
			retVal = 2;

		} else if (score >= 16 && score <= 17) {
			retVal = 3;

		} else if (score >= 18 && score <= 19) {
			retVal = 4;

		} else if (score >= 20 && score <= 21) {
			retVal = 5;

		} else if (score > 21) {
			retVal = 5;

		} else {
			retVal = 0;
		}

		return retVal;
	}
    

}
